<?php 

namespace app\token\controller;

use app\token\controller\TokenLogic;

class Token {
	protected static $Request;

	function __construct() {
		self::$Request = request()->param();
	}

	/**
	 * 验证token
	 */
	public function verifyRecordpenToken() {
		try {
			$token = self::$Request['token'];
			$res = TokenLogic::verifyRecordpenTokenLogic($token);
			if ($res->isSuccess) {
				return resultArray(['data' => $res->data]);
			}else {
				return resultArray(['error' => $res->info]);
			}
		} catch (Exception $e) {
			return resultArray(['error' => $e->getMessage()]);
		}
	}
}